{% extends 'base.html' %}

{% block title %}
台网信息
{% endblock title %}


{% block content %}
<h1 class="dash-title">台网信息</h1>
<div class="row">
    <div class="col-lg-12">
        <div class="card spur-card">
            <div class="card-header">
                <div class="spur-card-icon">
                    <i class="fas fa-table"></i>
                </div>
                <div class="spur-card-title">台网</div>
            </div>
            <div class="card-body">
                <table class="table table-hover table-in-card">
                    <thead>
                        <tr>
                            <th scope="col"><input type="checkbox" name="" id=""></th>
                            <th scope="col">序号</th>
                            <th scope="col">台网代码</th>
                            <th scope="col">台网名</th>
                            <th scope="col">台站数</th>
                            <th scope="col">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for net in network_list %}
                        <tr>
                            <td><input type="checkbox" name="" id=""></td>
                            <td>{{ forloop.counter }}</td>
                            <td><a href="{% url 'basic:station_list'%}?net__id__exact={{ net.id }}">{{ net.code }}</a>
                            </td>
                            <td>{{ net.name }}</td>
                            <td>{{ net.get_stations_count }}</td>
                            <td>
                                <a href="{% url 'basic:network_edit' net.slug %}">编辑</a>|
                                <a href="{% url 'basic:network_delete' net.slug %}">删除</a>
                            </td>
                        </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
            <div class="card-footer">
                <div class="text-muted">
                    台网数量: {{ network_list|length }}
                </div>
            </div>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-lg-12">
        <a class="btn btn-primary" href="{% url 'basic:network_add' %}">添加台网</a>
        <button type="submit" class="btn btn-danger">批量删除</button>
    </div>
</div>
{% endblock content %}